home *** CD-ROM | disk | FTP | other *** search
/ Mac Expert 1995 Winter / Mac Expert - Winter 95.iso / Les fichiers / Communications / AppleTalk Remote access / Scripts ARA ƒ / Apple Modem 2400 / Apple Modem 2400
Encoding:
Text File  |  1991-09-04  |  2.7 KB  |  188 lines  |  [mlts/slnk]

  1. @ORIGINATE
  2. @ANSWER
  3. !
  4. @LABEL 1
  5. serreset 2400, 0, 8, 1
  6. !
  7. ! first recall the factory configuration
  8. !
  9. @LABEL 2
  10. matchclr
  11. matchstr 1 4 "OK\13\10"
  12. matchstr 2 3 "ERROR\13\10"
  13. pause 5
  14. write "AT&F\13"
  15. matchread 30
  16. jump 59
  17. !
  18. ! The &F command failed, must be original portable modem, try Z
  19. !
  20. @LABEL 3
  21. matchclr
  22. matchstr 1 6 "OK\13\10"
  23. write "ATZ\13"
  24. matchread 30
  25. jump 59
  26. !
  27. !    Set up the configuration:
  28. !    direct connection mode, no mnp, no speed conversion
  29. !
  30. @LABEL 4
  31. matchstr 1 5 "OK\13\10"
  32. matchstr 2 6 "ERROR\13\10"
  33. write "AT\\N1\13"
  34. matchread 30
  35. !
  36. ! Next, turn off flow control.
  37. !
  38. @LABEL 5
  39. matchclr
  40. matchstr 1 6 "OK\13\10"
  41. write "AT&K0\13"
  42. matchread 30
  43. jump 59
  44. !
  45. ! Turn echo off
  46. !
  47. @LABEL 6
  48. matchclr
  49. matchstr 1 7 "OK\13\10"
  50. write "ATE0\13"
  51. matchread 30
  52. jump 59 
  53. !
  54. ! If speaker on flag is true, jump to label 8.  Else turn off the speaker
  55. @LABEL 7
  56. ifstr 2 8 "1"
  57. matchstr 1 8 "OK"
  58. write "ATM0\13"
  59. matchread 30
  60. jump 59
  61. !
  62. ! The modem is ready so enable answering, or originate a call
  63. !
  64. @LABEL 8
  65. pause 5
  66. ifANSWER 30
  67. note "Dialing ^1" 3
  68. write "ATDT^1\13"
  69. !
  70.  
  71. @LABEL 9
  72. matchstr 1 11 "CONNECT 1200"
  73. matchstr 2 12 "CONNECT 2400"
  74. matchstr 3 50 "NO CARRIER"
  75. matchstr 4 50 "ERROR"
  76. matchstr 5 52 "NO DIALTONE"
  77. matchstr 6 53 "BUSY"
  78. matchstr 7 54 "NO ANSWER"
  79. matchread 700
  80. jump 59
  81. !
  82. @LABEL 11
  83. note "Communicating at 1200 bps." 2
  84. serreset 1200, 0, 8, 1
  85. jump 15
  86. !
  87. @LABEL 12
  88. note "Communicating at 2400 bps." 2
  89. serreset 2400, 0, 8, 1
  90. !
  91. @LABEL 15
  92. ifANSWER 16
  93. pause 30
  94. @LABEL 16
  95. exit 0
  96. !
  97. ! @ANSWER
  98. ! Set up the modem to answer
  99. @LABEL 30
  100. write "ATS0=1\13"
  101. matchstr 1 31 "OK\13\10"
  102. matchread 30
  103. jump 59
  104. !
  105. @LABEL 31
  106. matchstr 1  32 "RING"
  107. matchstr 2  11 "CONNECT 1200"
  108. matchstr 3  12 "CONNECT 2400"
  109. matchstr 4  50 "NO CARRIER"
  110. matchstr 5  50 "ERROR"
  111. matchstr 6  52 "NO DIALTONE"
  112. matchstr 7  53 "BUSY"
  113. matchstr 8  54 "NO ANSWER"
  114. matchread 700
  115. jump 31
  116. !
  117. @LABEL 32
  118. userhook 1
  119. note "Answering phone…" 2
  120. jump 31
  121. !
  122. ! 50: error messages
  123. ! No carrier
  124. @LABEL 50
  125. exit -6021
  126. ! No Dial Tone
  127. @LABEL 52
  128. exit -6020
  129. ! Busy
  130. @LABEL 53
  131. exit -6022
  132. ! No Answer
  133. @LABEL 54
  134. exit -6023
  135. ! Modem error
  136. @LABEL 59
  137. exit -6019
  138. !
  139. ! Hang up the modem
  140. !
  141. @HANGUP
  142. @LABEL 60
  143. settries 0
  144. @LABEL 61
  145. write "ATH\13"
  146. matchclr
  147. matchstr 1 62 "NO CARRIER\13\10"
  148. matchstr 2 62 "OK\13\10"
  149. matchstr 3 62 "ERROR\13\10"
  150. matchread 30
  151. inctries
  152. iftries 3 62
  153. ! no response, try escape sequence
  154. write "+++"
  155. matchclr
  156. matchstr 1 61 "OK\13\10"
  157. matchread 15
  158. jump 61
  159. !
  160. ! Recall the factory settings
  161. !
  162. @LABEL 62
  163. matchclr
  164. matchstr 1 64 "OK\13\10"
  165. matchstr 2 63 "ERROR\13\10"
  166. write "AT&F\13"
  167. matchread 30
  168. !
  169. ! the &F failed, must be original portable modem, try Z
  170. !
  171. @LABEL 63
  172. matchclr
  173. matchstr 1 65 "OK\13\10"
  174. write "ATZ\13"
  175. matchread 30
  176. !
  177. ! Turn off auto answer
  178. !
  179. @LABEL 64
  180. write "ATS0=0\13"
  181. matchclr
  182. matchstr 1 65 "OK\13\10"
  183. matchread 30
  184. !
  185. @LABEL 65
  186. exit 0
  187.  
  188.